package com.psdi;

import com.psdi.controller.GameListener;
import com.psdi.controller.GameThread;
import com.psdi.window.GameJFrame;
import com.psdi.window.GameMainPanel;

/**
 * 游戏主类
 * 启动游戏窗口并显示主面板
 */
public class Main {
    public static boolean READY = false; // 游戏是否准备就绪
    public static boolean Start = false;// 游戏是否开始
    public static int FPS = 60; // 游戏帧率，默认为60帧每秒
    public static long MILLI_DELTA_TIME = 1000 / FPS; // 每帧的时间间隔，单位为毫秒
    public static float DELTA_TIME = 1.0f / FPS; // 每帧的时间间隔，单位为秒

    public static void main(String[] args) {
        READY = true;
        GameJFrame frame = new GameJFrame();
        GameMainPanel mainPanel = new GameMainPanel();
        GameListener gameListener = new GameListener();
        // 实例化游戏主线程
        GameThread gameThread = new GameThread();
        frame.setPanel(mainPanel);
        frame.setKeyListener(gameListener);
        frame.setMouseListener(gameListener);
        frame.setThread(gameThread);

        frame.start();

    }
}